Skip to content

experiment(debug): set the language to pascal to get better gdb syntax support#1676

Draft
ghaith wants to merge 5 commits intomasterfrom
debug_expressions
Draft

experiment(debug): set the language to pascal to get better gdb syntax support#1676
ghaith wants to merge 5 commits intomasterfrom
debug_expressions

Conversation

@ghaith
Copy link
Copy Markdown
Collaborator

@ghaith ghaith commented Apr 16, 2026

If we set the gdb language to pascal, it might instruct editors to respect array bounds.
it might also make expressions easier since a lot of the syntax is similar.

ghaith and others added 5 commits April 15, 2026 14:07
…control

The LLVM C API (LLVMDIBuilderCreateCompileUnit) does not expose the
NameTableKind parameter, which controls .debug_names accelerator table
emission. This adds a C++ wrapper that calls DIBuilder::createCompileUnit
directly, allowing us to set NameTableKind::None (matching clang's default)
or NameTableKind::Default for opt-in .debug_names emission.

The Rust side exposes a safe `create_debug_info()` function that hides
all raw pointer handling and transmutes behind a friendly inkwell-typed API.
…ility

When compiling multiple ST files with DWARF 5 debug info, each compilation
unit gets its own .debug_names table. The linker (lld) concatenates them,
but GDB cannot parse concatenated tables and warns:
  "Section .debug_names length X does not match section length Y"

This matches clang's default behavior of setting nameTableKind: None on
DICompileUnit. A new --gpubnames CLI flag allows opting back into
.debug_names emission when needed (e.g. for lldb-only workflows).
All debug test snapshots now include nameTableKind: None in the
DICompileUnit metadata, reflecting the new default behavior.
…t when lowering output assignment (#1657)

Co-authored-by: Ghaith Hachem <ghaith.hachem@bachmann.info>
Pascal83 is semantically closer to IEC 61131-3 Structured Text than C,
giving us case-insensitive symbol lookup and better type display in GDB
as a first step toward proper ST debugging support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 16, 2026

Build Artifacts

🐧 Linux

Artifact Link Size
deb-x86_64 Download 38.6 MB
schema Download 0.0 MB
stdlib Download 33.0 MB
plc-x86_64 Download 43.6 MB
deb-aarch64 Download 30.9 MB
plc-aarch64 Download 43.5 MB

From workflow run

🪟 Windows

Artifact Link Size
stdlib.lib Download 4.3 MB
stdlib.dll Download 0.1 MB
plc.exe Download 38.4 MB

From workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants